<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Google Shortcuts - All available services</title>
<style>
body {
  /*font: 15px/1 verdana, "bitstream vera sans", sans-serif;*/
  font-size: 11px;
  margin:10px;
  /*color:#5A5A5A;*/
}

/*a, a:visited {
	color:#2F7DBB;
	text-decoration:underline;
}

a:hover {
	text-decoration:none;	
}*/

dt, h1, h2, h3, h4 { letter-spacing: normal; text-transform: none;}
h1 { font-size: 21px; line-height: 23px; margin-bottom: 17px; }
h2 { font-size: 19px; line-height: 21px; margin-bottom: 19px; }
h3 { font-size: 17px; line-height: 19px; margin: 5px 0 21px 0; }
h4 { font-size: 15px; line-height: 17px; margin-bottom: 3px; }

.app {
  box-sizing: border-box;
  border-radius: 10px;
  color: black;
  margin: 5px 3px;
  /*margin-left:0;*/
  height: 136px;
  width: 124px;
  visibility: hidden;
  background-color: transparent;
  background-position: center center;
  background-repeat: no-repeat;
  border: 0;
  height: 14px;
  padding: 0;
  position:absolute;
  /*right: 5px;
  top: 0px;
  width: 14px;*/
}

.app a {
  border-radius: 10px;
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 100;
  -webkit-transition: background-color .5s;
  background: rgba(255, 255, 255, 0) /* transparent white */
              no-repeat center 9px;
  background-size: 64px 64px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: black;
  overflow: hidden;
  padding: 79px 5px 5px;  /* 10 + 64 + 5 */
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  filter: gray;
}

#apps-content[launcher-animations=true] .app {
  -webkit-transition: top .2s, left .2s, right .2s, opacity .2s;
}

#apps-content.visible .app {
  visibility: visible;
}

.app a:hover {
  -webkit-transition-delay: .1s;
  background-color:#E5E5E5;
  
  white-space:normal;
}

.back {
	border-top:1px solid rgba(229, 229, 229, 1);
}
</style>
</head>

<body>
<div id="rest" align="center"></div>
<div id="container" align="center"></div>

<script>
var wholeshebang;
var completelist;
var userlist;
var completeListArray = new Array();
var completeListArrayLength;
var wholeshebangArray = new Array();
var wholeshebangArrayLength;
var userListArray = new Array();
var userListArrayLength;

init();

function init() {
	completelist = localStorage.completelist || "";
	wholeshebang = localStorage.wholeshebang || "";
	userlist = localStorage.userList || "";
	
	completeListArray = completelist.split(',');
	completeListArray.pop();
	completeListArray.sort(function(x,y){ 
		var a = String(x).toUpperCase(); 
		var b = String(y).toUpperCase(); 
		if (a > b) 
			return 1 
		if (a < b) 
			return -1 
		return 0; 
	});
	
	allServices = ""
	
	notApplicableArray = [];
	
	for (i in completeListArray) {
		url = localStorage.getItem(completeListArray[i] + '_url');
		if (url.search("http") == -1) {
			notApplicableArray.push(completeListArray.splice(i, 1));
		}
	}
	
	completeListArrayLength = completeListArray.length;
	
	for (i=0;i<completeListArrayLength;i++) {
		name = completeListArray[i];
		short_name = completeListArray[i].replace(/\ /g, "").toLowerCase();
		url = localStorage.getItem(completeListArray[i] + '_url');
		tooltip = name + "\n" + localStorage.getItem(completeListArray[i] + '_tooltip');
		styleLeft = (i%7) * 130;
		styleTop = Math.ceil((i+1)/7) * 130;
		
		allServices += "<span class='app' style='left: " + styleLeft + "px; top: " + styleTop + "px;'><a href='" + url + "' style='background-image: url(images/new_images/" + short_name + "-64.png);' title='" + tooltip + "'>" + name + "</a></span>";
		
		/*if((i+1)%7 == 0)
			allServices += "<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>";*/
	}
	
	restServices = "";
	
	for (i in notApplicableArray) {
		restServices += notApplicableArray[i] + ", ";
	}
	
	document.getElementById("container").innerHTML = '<div id="apps-content" style="margin-top: 200px; max-width:780px;" launcher-animations="true" class="visible" align="center">' + allServices + '</div>';
	document.getElementById("rest").innerHTML = restServices;
}
</script>
</body>
</html>
